<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>用户登录</title>
<link href="${pageContext.request.contextPath}/css/loginstyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="container">
        <div class="login-wrapper">
            <div class="header">用户登录</div>
            <form action="${pageContext.request.contextPath}/LoginServlet" method="post">
                <div class="form-wrapper">
                    <input type="text" name="id" id="id" placeholder="请输入用户名" class="input-item" required>
                    <input type="password" name="password" id="password"  placeholder="请输入密码" class="input-item" required>
                  <!-- 放一个错误信息显示 -->
                   <% 
        				// 获取请求中的错误消息（如果有）
        				String loginError = (String) request.getAttribute("loginError");
        				if (loginError != null) {
    				%>
        			<p style="color: red;"><%= loginError %></p>
    				<% } %>
                    <input type="submit" value="登录" class="btn">
                  </div>
                <div class="msg">
                    <div>欢迎使用宿舍管理系统</div>
                </div>
            </form>
            
        </div>
    </div>
    
    
    
    
</body>
</html>